package com.cloud.service;

import com.cloud.common.domain.Result;
import com.cloud.domain.LoginUser;
import com.cloud.entity.AuthBody;
import com.cloud.entity.AuthUser;
import com.cloud.utils.ServiceConstants;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Feign服务调用
 * 认证模块
 */
@Component
@FeignClient(value = ServiceConstants.TlxxModulesSecurity)
public interface FeignSecurityService {

    /**
     * 根据code获取浙政钉用户信息
     */
    @LoadBalanced
    @PostMapping(value = "/security/client/inAuth/getDingGrantAuthInfo")
    public Result<AuthUser> getDingGrantAuthInfo(@RequestBody AuthBody authBody);

    /**
     * 根据Token获取账户信息
     */
    @LoadBalanced
    @RequestMapping(value = "/security/info/inAuth/getLoginUser")
    public Result<LoginUser> getLoginUser(@RequestBody AuthBody authBody);

}
